package one.stand.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import one.stand.aop.ApiController;
import one.stand.model.ResultModel;
import one.stand.request.SeeRecordRequest;
import one.stand.request.TokenRequest;
import one.stand.response.CrmCustomerAnalysisRespnse;
import one.stand.response.CrmSeeRecordResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 */
@RequestMapping("crmApi/seeRecord")
@RestController
@Api(description = "查看记录系列")
public class SeeRecordController extends BaseController {

    @ApiOperation("圆饼图")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "客户ID（用户客户分析）", paramType = "Integer"),
            @ApiImplicitParam(name = "dayNum", value = "天数", paramType = "Integer"),
            @ApiImplicitParam(name = "type", value = "1个人数据2企业数据", paramType = "Integer"),
    })
    @ApiController(isLogin = true, company = true,card = true,paramClass =SeeRecordRequest.class )
    @PostMapping("countCustomerAnalysis")
    public ResultModel<List<CrmCustomerAnalysisRespnse>> countCustomerAnalysis(@RequestAttribute SeeRecordRequest request) {
        
        return crmFegin.countCustomerAnalysis(request);
    }

    @ApiOperation("客户与我的互动")
    @ApiController(isLogin = true, company = true,card = true,paramClass =SeeRecordRequest.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "客户ID（用于客户分析）", paramType = "Integer"),
            @ApiImplicitParam(name = "type", value = "1个人数据2企业数据", paramType = "Integer"),
    })
    @PostMapping("customerAnalysis")
    public ResultModel customerAnalysis(@RequestAttribute SeeRecordRequest request) {
        
        return crmFegin.customerAnalysis(request);
    }

    @ApiOperation("名片查看记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "客户id（查询客户的各种记录）", paramType = "Integer"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, paramType = "Integer"),
            @ApiImplicitParam(name = "pageNum", value = "当前页", required = true, paramType = "Integer"),
            @ApiImplicitParam(name = "entranceType", value = "入口类型（1:时间追踪，2：行为追踪，3：ai分析,4,成交率（查看类型必须是2））", required = true, paramType = "Integer"),
            @ApiImplicitParam(name = "seeType", value = "查看类型 1:名片，2:产品，3：官网,4:查看动态", paramType = "Integer"),
    })
    @ApiController(isLogin = true, company = true,card = true,paramClass =SeeRecordRequest.class)
    @PostMapping("getSeeRecordList")
    public ResultModel<List<CrmSeeRecordResponse>> getSeeRecordList(@RequestAttribute SeeRecordRequest request) {
        
        return crmFegin.getSeeRecordList(request);
    }

}
